/**

 */
package com.adkfp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.adkfp.bean.ADKManageUserBean;
import com.adkfp.bean.ADKManageUserRoleBean;
import com.adkfp.dao.ADKManageUserDaoMapper;
import com.adkfp.service.IADKManageUserService;

/**
 * class name:SelectclassAction <BR>
 * class description: please write your description <BR>
 * Remark: <BR>
 * @version 1.00 2019年1月24日
 * @author ADK)zhoulin
 */
@Service("aDKManageUserService")
public class ADKManageUserServiceImpl implements IADKManageUserService{
	@Resource
	private ADKManageUserDaoMapper aDKManageUserMapper;

	//插入一条记录
	@Override
	@Transactional
	public void insert(ADKManageUserBean bean) {
		aDKManageUserMapper.insert(bean);
	}

	//根据bean里面的条件(非空)查询所有记录
	@Override
	@Transactional
	public List<ADKManageUserBean> findByCondition(ADKManageUserBean bean) {
		return aDKManageUserMapper.findByCondition(bean);
	}

	//根据bean里面的条件(非空)查询所有记录条数
	@Override
	@Transactional
	public long findByConditionCount(ADKManageUserBean bean) {
		return aDKManageUserMapper.findByConditionCount(bean);
	}

	//删除一条记录
	@Override
	@Transactional
	public void delete(Integer id) {
		aDKManageUserMapper.delete(id);
	}

	//更新一条记录
	@Override
	@Transactional
	public void update(ADKManageUserBean bean) {
		aDKManageUserMapper.update(bean);		
	}

	//根据id查询一条记录
	@Override
	public ADKManageUserBean findById(Integer id) {
		return aDKManageUserMapper.findById(id);
	}

	@Override
	public List<ADKManageUserBean> afindByCondition(ADKManageUserBean bean) {
		return aDKManageUserMapper.afindByCondition(bean);
	}

	@Override
	public long afindByConditionCount(ADKManageUserBean bean) {
		return aDKManageUserMapper.afindByConditionCount(bean);
	}

	//删除某个用户的某个角色
	@Override
	public void deleteUserRole(String userId, String roleId) {
		aDKManageUserMapper.deleteUserRole(userId, roleId);
	}

	@Override
	public void insertjuese(ADKManageUserRoleBean bean) {
		aDKManageUserMapper.insertjuese(bean);		
	}

	@Override
	public List<ADKManageUserBean> bfindByCondition(ADKManageUserBean bean) {
		return aDKManageUserMapper.bfindByCondition(bean);
	}

	@Override
	public long bfindByConditionCount(ADKManageUserBean bean) {
		return aDKManageUserMapper.bfindByConditionCount(bean);
	}

	//登录
	@Override
	@Transactional
	public ADKManageUserBean login(String userName, String password, Integer role) {
		return aDKManageUserMapper.login(userName, password, role);
	}
	//修改密码
	/*@Override
	public void updateManageUserPassword(Integer id, String password) {
		ADKManageUserBean manageUser = new ADKManageUserBean();
		manageUser.setId(id);
		manageUser.setPassword(password);
		aDKManageUserMapper.update(manageUser);
	}*/

	@Override
	public List<Integer> getRoleByUserId(String userId) {
		return null;
	}

	@Override
	public void deleteUserRoleByRole(String roleId) {
		aDKManageUserMapper.deleteUserRoleByRole(roleId);		
	}

	@Override
	public int CfindByConditionCount(ADKManageUserBean paramUser) {
		// TODO Auto-generated method stub
		return aDKManageUserMapper.CfindByConditionCount(paramUser);
	}

	@Override
	public List<ADKManageUserBean> CfindByCondition(ADKManageUserBean paramUser) {
		// TODO Auto-generated method stub
		return aDKManageUserMapper.CfindByCondition(paramUser);
	}

	@Override
	public List<ADKManageUserBean> aafindByCondition(ADKManageUserBean bean, Integer id) {
		// TODO Auto-generated method stub
		return aDKManageUserMapper.aafindByCondition(bean,id);
	}

	@Override
	public List<ADKManageUserBean> BfindByCondition(ADKManageUserBean bean) {
		// TODO Auto-generated method stub
		return aDKManageUserMapper.BfindByCondition(bean);
	}
	
      //修改密码
	@Override
	public void updateManageUserPassword(Integer id, String password) {
		ADKManageUserBean bean=new ADKManageUserBean();
		bean.setId(id);
		bean.setPassword(password);
		aDKManageUserMapper.update(bean);
	}


}
